package com.ruoyi.project.module.report.controller;

import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.project.module.report.service.impl.ReportServicePlusImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * 报告管理Controller
 * 
 * @author javen
 * @date 2020-12-20
 */
@Controller
@RequestMapping("/module/report")
public class ReportControllerPlus  {

    @Autowired
    private ReportServicePlusImpl reportService;

    /**
     * 上传报告
     */
    @PostMapping("/upload")
    @ResponseBody
    public AjaxResult uploadFile(MultipartFile file) {
        try {
            AjaxResult result = AjaxResult.success();
            reportService.uploadReport(file,result);
            return result;
        }
        catch (Exception e) {
            return AjaxResult.error(e.getMessage());
        }
    }

}
